<?php    
    class ResultSet implements IResultSet {
        private $_rsltArray;
        private $_rowNum; 
        private $_numItems;
        
        public function __construct($rslts) {
            $this->_rowNum = 0;
            $this->_rsltArray = $rslts;
            $this->_numItems = count($rslts);
        }
        
        public function nextItem() {
            $this->_rowNum++;
        }
        
        public function previousItem() {
            $this->_rowNum--;
        }
        
        public function currentItem() {
            return $this->_rsltArray[$this->_rowNum];
        }
        
        public function findItem($key) {
            $row = $this->_rsltArray[$this->_rowNum];
            return $row[$key];
        }
        
        public function numItems() {
            return $this->_numItems;
        }
    }
?>